@header-height: 50px;

/***
Dropdown
***/
/*Fixing dropdown issue on mobile devices in Bootstrap 3.2.2*/
.dropdown-backdrop {
    position: static;
}

.dropdown:hover .caret,
.open.dropdown .caret {
    opacity: 1;
    filter: alpha(opacity=100);
}

.dropdown.open .dropdown-toggle {
    color: #08c;
    background: #ccc;
    background: rgba(0, 0, 0, 0.3);
}

/***
Dropdown Menu
***/
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    list-style: none;
    text-shadow: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    -webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    border: 1px solid #ddd;
}

/* custom dropdown conetnt */
.dropdown-content {
    padding: 5px;
}

.dropdown-content form {
    margin: 0;
}

.dropdown.inline .dropdown-menu {
    display: inline-block;
    position: relative;
}

.dropdown-menu.bottom-up {
    top: auto;
    bottom: 100%;
    margin-bottom: 2px;
}

.dropdown-menu li > a {
    padding: 6px 0 6px 18px;
    color: @B900;
    text-decoration: none;
    display: block;
    clear: both;
    font-weight: normal;
    line-height: 18px;
    white-space: nowrap;
    margin: 0;
    font-size: 14px;
}

.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
    text-decoration: none;
    background-image: none;
    background-color: @H050;
    color: @B900;
    filter: none;
}

/* dropdown sub menu support for Bootsrap 3 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 5px;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropup {
    .dropdown-submenu > .dropdown-menu {
        top: auto;
        bottom: 0;
        margin-top: 0;
        margin-bottom: -2px;
    }
    .dropdown-menu {
        margin-bottom: -1px;
        min-width: inherit;
        width: 100%;
        border-bottom: none;
        border-color: @B500;
        -webkit-box-shadow: none;
        -moz-box-shadow: none;
        box-shadow: none;
    }
    &.btn-sm {
        padding: 0 !important;
        .dropdown-toggle {
            padding: 4px 10px;
        }
        .dropdown-menu {
            bottom: 30px;
            font-size: 14px;
            top: auto;
        }
        i {
            font-size: 15px;
            top: 8px;
        }
    }
}

.dropdown-submenu > a:after {
    position: absolute;
    display: inline-block;
    font-size: 14px;
    right: 10px;
    top: 7px;
    font-family: FontAwesome;
    height: auto;
    content: "\f105";
    font-weight: 300;
}

.dropdown-submenu:hover > a:after {
    border-left-color: #fff;
}

.dropdown-submenu.pull-left {
    float: none;
}

.dropdown-submenu.pull-left > .dropdown-menu {
    left: -100%;
    margin-left: 10px;
}

/***
Dropdown Checkboxes (in v1.3)
***/
.dropdown-checkboxes {
    padding: 5px;
}

.dropdown-checkboxes label {
    display: block;
    font-weight: 300;
    color: #333;
    margin-bottom: 4px;
    margin-top: 4px;
}

/***
Dropdown Menu Badges
***/
.dropdown-menu > li > a > .badge {
    position: absolute;
    margin-top: 1px;
    right: 3px;
    display: inline;
    font-size: 11px;
    font-weight: 300;
    text-shadow: none;
    height: 18px;
    padding: 3px 6px;
    text-align: center;
    vertical-align: middle;
    -webkit-border-radius: 12px !important;
    -moz-border-radius: 12px !important;
    border-radius: 12px !important;
}

.dropdown-menu > li > a > .badge.badge-roundless {
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    border-radius: 0 !important;
}

/***
Dropdown
***/
/*Fixing dropdown issue on mobile devices in Bootstrap 3.2.2*/
.dropdown-backdrop {
    position: static;
}

.dropdown:hover .caret,
.open.dropdown .caret {
    opacity: 1;
    filter: alpha(opacity=100);
}

.dropdown.open .dropdown-toggle {
    color: #08c;
    background: #ccc;
    background: rgba(0, 0, 0, 0.3);
}

/***
Dropdown Menu
***/
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    list-style: none;
    text-shadow: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    -webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    border: 1px solid #ddd;
}

.header .dropdown-menu {
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
    border: 1px solid @H500;
    overflow: hidden;
}

._dropdown-scroll {
    background: #fff;
    height: 20px;
    line-height: 12px;
    position: absolute !important;
    text-align: center;
    z-index: 10001;
    left: 0;
    &.disabled {
        color: #ddd;
    }
}

.open .dropdown-container > .dropdown-menu {
    display: block;
}

.open .dropdown-container > .dropdown-wrap {
    display: block;
}

.dropdown-container {
    .dropdown-wrap {
        height: 300px;
        overflow: hidden;
        position: absolute;
        top: @header-height;
        z-index: 1000;
        display: none;
        float: left;
        list-style: none;
        text-shadow: none;
        padding: 0;
        margin: 0;
        background-color: #fff;
        font-size: 14px;
        border: 1px solid @H500;
        &.dropdown-level-first {
            left: 0;
            border-top: none;
        }
        &.dropdown-level-second {
            left: 279px;
            display: none;
        }
        &.dropdown-level-third {
            left: 558px;
            display: none;
        }
        .dropdown-menu {
            display: block;
            position: relative;
            top: 0;
            border: none;
            margin: 0;
            -webkit-box-shadow: none;
            -moz-box-shadow: none;
            box-shadow: none;
        }
        .dropdown-scroll-top {
            ._dropdown-scroll;
            top: 0;
        }
        .dropdown-scroll-bottom {
            ._dropdown-scroll;
            bottom: 0;
        }
        .dropdown-scroll-top + .dropdown-menu {
            top: 20px;
        }
        .dropdown-submenu {
            .dropdown-menu {
                display: none !important;
            }
        }
    }
}

/* custom dropdown conetnt */
.dropdown-content {
    padding: 5px;
}

.dropdown-content form {
    margin: 0;
}

.dropdown.inline .dropdown-menu {
    display: inline-block;
    position: relative;
}

.dropdown-menu.bottom-up {
    top: auto;
    bottom: 100%;
    margin-bottom: 2px;
}

.nav.pull-right > li > .dropdown-menu,
.nav > li > .dropdown-menu.pull-right {
    right: 0;
    left: auto;
}

.nav.pull-right > li > .dropdown-menu:before,
.nav > li > .dropdown-menu.pull-right:before {
    right: 12px;
    left: auto;
}

.nav.pull-right > li > .dropdown-menu:after,
.nav > li > .dropdown-menu.pull-right:after {
    right: 13px;
    left: auto;
}

.nav.pull-right > li > .dropdown-menu .dropdown-menu,
.nav > li > .dropdown-menu.pull-right .dropdown-menu {
    right: 100%;
    left: auto;
    margin-right: -1px;
    margin-left: 0;
    -webkit-border-radius: 6px 0 6px 6px;
    -moz-border-radius: 6px 0 6px 6px;
    border-radius: 6px 0 6px 6px;
}

@media (max-width: 767px) {
    .navbar-nav .open .dropdown-menu {
        position: absolute;
        float: left;
        width: auto;
        margin-top: 0;
        background-color: #fff;
        border: 1px solid #ddd;
        -webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
        -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav .open .dropdown-menu > li > a {
        padding: 6px 0 6px 13px;
        color: #333 !important;
    }

    .navbar-nav .open .dropdown-menu > li > a:hover,
    .navbar-nav .open .dropdown-menu > li > a:focus {
        background-color: #eee !important;
    }
}

/* bagin: sidebar menu badges */
/***
Dropdown Checkboxes (in v1.3)
***/
.dropdown-checkboxes {
    padding: 5px;
}

.dropdown-checkboxes label {
    display: block;
    font-weight: 300;
    color: #333;
    margin-bottom: 4px;
    margin-top: 4px;
}

/***
Dropdown Menu Badges
***/
.dropdown-menu > li > a > .badge {
    position: absolute;
    margin-top: 1px;
    right: 3px;
    display: inline;
    font-size: 11px;
    font-weight: 300;
    text-shadow: none;
    height: 18px;
    padding: 3px 6px;
    text-align: center;
    vertical-align: middle;
    -webkit-border-radius: 12px !important;
    -moz-border-radius: 12px !important;
    border-radius: 12px !important;
}

.dropdown-menu > li > a > .badge.badge-roundless {
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    border-radius: 0 !important;
}
/***
修复点击按钮后小三角抖动的问题
***/
.dropdown.open .dropdown-toggle {
    color: @B000;
}

.btn-dropdown.open .dropdown-toggle i {
    top: 9px;
}
.btn-dropdown.btn-lg .dropdown-toggle{
    .pos(r);
}
.btn-dropdown.btn-lg.open .dropdown-toggle i {
    top: 12px;
}

.btn-dropdown.btn-sm.open .dropdown-toggle i {
    top: 7px;
}
